package javaEEBasic.day01;

import java.util.Scanner;

public class Day01 {
    public static void main(String[] args) {

        //test01();
//        test03();
//        test04();
        test06();

    }

    public static void test06() {
        int a = 10;
        int b = 3;
        System.out.println("----两变量的加减乘除----------");
        System.out.println("a+b:" + (a + b));
        System.out.println("a-b:" + (a - b));
        System.out.println("a*b:" + (a * b));
        System.out.println("a/b:" + (a / b));
        System.out.println("步骤3----------");
        System.out.println("++a:" + (++a));
        System.out.println("b++:" + (b++));
        System.out.println("步骤4-------------");
        System.out.println( a + b > 10 && a*b > 20);
        System.out.println("步骤5-------------");
        int c = (int) 3.14;
         System.out.println(c);
        System.out.println("步骤6----------");
        Scanner sc  = new Scanner(System.in);
        int e = sc.nextInt();
        int f = sc.nextInt();
        System.out.println("max(e,f):" + ( e > f ? e : f));
    }

    public static void test05() {
        // 复合赋值运算符的隐式类型转换
        int a = 10;
        double b = 12.3;
        a += b; //等价与 a = (int) a + b;
        System.out.println(a); //22
        System.out.println(a + b); //34.3
        b += a;
        System.out.println(b);
    }

    public static void test03() {
        int a = 65, b = 97;
        System.out.println("a:" + (char) a);
        System.out.println("b:" + (char) b);
        a += 10;
        b += 10;
        System.out.println("a:" + (char) a);
        System.out.println("b:" + (char) b);
        char c = 110;
        System.out.println("c:" + c);

    }

    public static void test04() {
        //A-Z 65-90
        // a-z 97-122
        char a = 'z';
        int b = a;
        System.out.println("a:" + a);
        System.out.println("b:" + b);
        int c = 0B1110;
        int d = 0107;
        int e = 0x5b3;
        System.out.println("c:" + c);
        System.out.println("d:" + d);
        System.out.println("e:" + e);
        System.out.println(-5.0 % 2.0);
    }

    public static void test01() {
        int a = 1;
        double b = 2.5;
        boolean c = true;
        a = (int) b;
        System.out.println("a:" + a);
        b = a;
        System.out.println("b:" + b);
    }

    public static void test02() {
        //        System.out.println("张三");
//        System.out.println("男");
//        System.out.println("18");
//        System.out.println(1.78);
//        System.out.println(false);
//        int a = 0B1010;
//        int b = 0111;
//        int c = 0xA1;
//        System.out.println(a);
//         System.out.println(b);
//         System.out.println(c);
//         byte d = 100 + 1;
    }
}
